<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_CreateTable_Captcha extends CI_Migration
{
    public function up()
    {
        $this->dbforge->add_field('id');
        $this->dbforge->add_field(array(
            'time' => array('type' => 'INT', 'constraint' => '10',),
            'ip'   => array('type' => 'VARCHAR', 'constraint' => '16', 'default' => '0'),
            'word' => array('type' => 'VARCHAR', 'constraint' => '20',),
        ));
        $this->dbforge->add_key('word');
        $this->dbforge->create_table('captcha');
    }

    public function down()
    {
        $this->dbforge->drop_table('captcha');
    }
} 